<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html manifest="manifest.appcache" xmlns="http://www.w3.org/1999/xhtml">
    <head>
		<?php
			@SESSION_START(); 
			include('model/main.php');
			os::gzip();
		?>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta content="DESIGN BY CUONGIT1981" ><meta name="description" content="CỬA HÀNG"/>
		<meta name="keywords" content="CỬA HÀNG"/>
		<meta name="description" content="CỬA HÀNG" />
		<meta property="og:url" content="CỬA HÀNG" />
		<title>SHOPPING365.VN - CỬA HÀNG <?php echo $_SESSION['shop'][3]." - ".$_SESSION['shop'][7] ; ?> </title>
		<link rel="shortcut icon" href="/images/365.JPG" />
		<script type="text/javascript" src="js/main.js" ></script>
		<link rel="stylesheet" type="text/css" media="screen" href="css/main.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
		<script src="js/jquery-1.11.0.js" type="text/javascript"></script>
		<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="js/jquery-1.3.2.js"></script>	 
		<link rel="stylesheet" type="text/css" href="lib/imgmove/css/component.css" />
		<script src="lib/imgmove/js/modernizr.custom.js"></script>
				<script type="text/JavaScript">
		var message="NoRightClicking"; function defeatIE() {if (document.all) {(message);return false;}} function defeatNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;} else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;} document.oncontextmenu=new Function("return false") 
		</script>
		<div id="fb-root"></div>
		<style>
			.zoom {
				display:inline-block;
				position: relative;
			}
			.zoom img {
				display: block;
			}
			.zoom img::selection { background-color: transparent; }
		</style>
		<script>(function(d, s, id) {
			  var js, fjs = d.getElementsByTagName(s)[0];
			  if (d.getElementById(id)) return;
			  js = d.createElement(s); js.id = id;
			  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
			  fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));
		</script>
		<script src='js/jquery.zoom.js'></script>
		<?php
			function get_infor_from_address($address = null) {
				$prepAddr = str_replace(' ', '+', stripUnicode($address));
				$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
				$output = json_decode($geocode);
				return $output;
			}
			function stripUnicode($str){
				if(!$str) return false;
				$unicode = array(
					'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ',
					'd'=>'đ|Đ',
					'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ',
					'i'=>'í|ì|ỉ|ĩ|ị|Í|Ì|Ỉ|Ĩ|Ị',
					'o'=>'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ỗ|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ',
					'u'=>'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự',
					'y'=>'ý|ỳ|ỷ|ỹ|ỵ|Ý|Ỳ|Ỷ|Ỹ|Ỵ',
				);
				foreach($unicode as $nonUnicode=>$uni) $str = preg_replace("/($uni)/i",$nonUnicode,$str);
				return $str;
			}  
			$address = get_infor_from_address($_SESSION['shop'][3]." - ".$_SESSION['shop'][8]);
			$x = $address->results[0]->geometry->location->lat ;
			$y = $address->results[0]->geometry->location->lng ;
			$adr = $_SESSION['shop'][2]." - ".$_SESSION['shop'][3]." - ".$_SESSION['shop'][8]; 
		?>
		<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=vi"></script>
		<script>
			js = new controls();
			setInterval("js.clock()",1000);		
			
			var map;
			function initialize() {
				var myLatlng = new google.maps.LatLng(<?php echo json_encode($x); ?>,<?php echo json_encode($y); ?>);
				var mapOptions = {
					zoom: 15,
					center: myLatlng,
					mapTypeId: google.maps.MapTypeId.ROADMAP
				};
				map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
				var text;
				text= "<div style='color:#000;font-weight:800;text-align:center;padding:10px'> "+<?php echo json_encode($adr); ?>+" </div>";
				var infowindow = new google.maps.InfoWindow({ content: text,
						size: new google.maps.Size(550,360),
						position: myLatlng
				});
				infowindow.open(map);    
				var marker = new google.maps.Marker({
					  position: myLatlng,
					  map: map,
					  title:"MAP !"
				});
			}		
			google.maps.event.addDomListener(window, 'load', initialize);
			setInterval("js.clock()",1000);	
			
			var strquery = (window.location.search.replace('?id=','')).toLowerCase();
			var temp = strquery.split('_');
			var tenchuyenmuc = js.getTenChuyenMuc(temp[0]);
			var nhomsp = js.getTenNhomSP(temp[0]);	
		</script>
		<script>
			/* Kiểm tra sessionStorage.cuahang da ton tai chua ? Hoac kiem tra sessionStorage.cuahang co giong stringquery khong ? Nếu không thì setup lại sessionStorage cho dung. */
			if( !sessionStorage.cuahang || sessionStorage.cuahang != strquery) {sessionStorage.cuahang = strquery ;	js.ref(strquery,'shop');}
		</script>
	</head>
    <body style="overflow-x:hidden;">	
		<img src='<?php echo config::getURL(); ?>images/a5.jpg' width="100%" height="100%" style="position:fixed;top:0;left:0;opacity:0.8" />
		<?php 
			if($_SESSION['shop'] != null){
		?>
			<div id="cuahang">
				<div id="top-head">
					<center>
						<div id="bannershopping365-content">
							<span><a href=""><script>document.write(tenchuyenmuc);</script></a></span>
							<span>
								<b> <a> . <script>document.write(nhomsp);</script></a>			&nbsp;&nbsp;&nbsp;&nbsp;					
								<a href=""><?php echo $_SESSION['shop'][2] ; ?></a>				&nbsp;&nbsp;&nbsp;&nbsp;	
								<a href="javascript:" onclick="js.ref(<?php echo $_SESSION['shop'][0] ; ?>,'map')"><?php echo $_SESSION['shop'][3]." - ".$_SESSION['shop'][8] ; ?> </a>			&nbsp;&nbsp;&nbsp;&nbsp;	
								<a >ĐT : <?php echo $_SESSION['shop'][5] ; ?></a>		&nbsp;&nbsp;&nbsp;&nbsp;
								</b>	
							</span>
						</div>
					</center>
				</div>
				<div id="top-head2"></div>
				<center>
					<div style="width:900px;margin:0 auto;padding-top:20px;position:relative;clear:both;
						-webkit-animation: appear 0.6s ease-in-out 1s backwards;
						-moz-animation: appear 0.6s ease-in-out 1s backwards;
						-o-animation: appear 0.6s ease-in-out 1s backwards;
						-ms-animation: appear 0.6s ease-in-out 1s backwards;
						animation: appear 0.6s ease-in-out 1s backwards;">
						<?php 
							if($_SESSION['shop']){
								$accShop = null;
								$accShop = data::getaccounts($_SESSION['shop'][1]);		
								if($accShop!=null){
						?>
								<div class="bannershop">
									<img width="870px" height="220px" alt="banner shop" title="banner cửa hàng" src="<?php echo config::getURL(); ?>images/cuahang/logo/<?php echo $_SESSION['shop'][4] ;?>"  />
									<img id="avar" width="160px" height="180px" alt="" title="<?php echo($accShop[1]) ;?> " src="<?php echo config::getURL(); ?>images/taikhoan/avatar/<?php echo $accShop[2] ;?>" />  
									<a href="https://www.facebook.com/<?php echo $accShop[3]; ?>" title="Địa chỉ facebook ">https://www.facebook.com/<?php echo $accShop[3]; ?></a>  
									<div class="commentfacebook">
										<div class="fb-share-button" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="250px" data-type="button">   <?php echo $accShop[3]; ?>  &nbsp; </div>&nbsp; &nbsp;
										<div class="fb-like" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="250px" data-layout="button" data-action="like" data-show-faces="true" data-share="false"> &nbsp; &nbsp;</div>&nbsp; &nbsp;
										<p class="fb-comments" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="880px" data-numposts="50" data-colorscheme="dark" style="font-size:11px;overflow-y:scroll;overflow-x:hidden;padding-bottom:40px;height:47px;border-radius:2px;box-shadow:0px 1px 4px #000"></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		
									</div>
								</div>
						<?php
								}
							} 
						?>
						<ul id="elasticstack" class="elasticstack">			
							<?php 
								if($_SESSION['shopProduct']){
									$count = 0;
									foreach($_SESSION['shopProduct'] as $x){
							?>
										<li >
											<img title="double click để xem chi tiết , move ảnh để xem tiếp ." width="300px" alt="" src="<?php echo config::getURL(); ?>images/thoitrang/ao/<?php echo $x[2] ;?>"  ondblclick="js.setDataProduct(strquery,<?php echo $x[0]; ?>,'sanpham');" /><p>Giá : <?php echo convert::price($x[6]); ?></p>
											<span ><?php echo $x[1] ;?> <br/> <?php echo  $_SESSION['shop'][0]."#".$x[0] ;?></span>
										</li>
							<?php
										++$count;
									}
								} else {
							?>	
									
							<?php
								}
							?>
						</ul>
						<script src="<?php echo config::getURL(); ?>lib/imgmove/js/draggabilly.pkgd.min.js"></script>
						<script src="<?php echo config::getURL(); ?>lib/imgmove/js/elastiStack.js"></script>
						<script>new ElastiStack( document.getElementById( 'elasticstack' ) );</script>
						<div class="shopmap">
							<div id="map-canvas" style="height:320px"></div>
						</div>
					</div>	
				</center>
				<div style="width:100%;height:80px;clear:both"></div>
				<center>
					<div style="width:900px;position:relative;padding-top:0px;margin:5px;
						-webkit-animation: appear 0.6s ease-in-out 1s backwards;
						-moz-animation: appear 0.6s ease-in-out 1s backwards;
						-o-animation: appear 0.6s ease-in-out 1s backwards;
						-ms-animation: appear 0.6s ease-in-out 1s backwards;
						animation: appear 0.6s ease-in-out 1s backwards;">
							<div class="box-bar-none"></div>
							<div class="box-bar-none"></div>
							<div class="box-bar-none"><img class="box-bar-img" width="180px" height="180px" src="<?php echo config::getURL(); ?>images/1.png"/></div>
							<div class="box-bar"></div>
							
							<div class="box-bar-none"></div>			
							<div class="box-bar-none"><img class="box-bar-img" width="180px" height="180px" src="<?php echo config::getURL(); ?>images/2.png"/></div>
							<div class="box-bar"></div>
							<div class="box-bar"></div>
										
							<div class="box-bar-none"><img class="box-bar-img" width="180px" height="180px" src="<?php echo config::getURL(); ?>images/3.png"/></div>
							<div class="box-bar"></div>
							<div class="box-bar"></div>
							<div class="box-bar"></div>
							
							<div class="box-bar"></div>
							<div class="box-bar"></div>
							<div class="box-bar"></div>
							<div class="box-bar"></div>
					</div>
				</center>
				
				<div style="clear:both;width:100%;height:150px;"></div>
				<div id="bottom-head">
					<center>
						<?php 	
							$now = getdate(); 
							if($now["mday"]<10) $now["mday"] = '0'.$now["mday"];
							if($now["mon"]<10) $now["mon"] = '0'.$now["mon"];	
						?>
							<a href="http://www.shopping365.vn" style="-webkit-animation: appear 0.8s ease-in-out 0.8s backwards;-moz-animation: appear 0.8s ease-in-out 0.8s backwards;font-size:80px;color:#b00;z-index:99900;position:fixed;bottom:55px;right:100px;text-shadow:-2px -1px 0 #000 !important">SHOPPING 365</a>			
							<div id="bottom-head-content">
								<a>	
									<b><?php echo $now["mday"]."/".$now["mon"]."/".$now["year"] ; ?>	</b>&nbsp;
									<b id="clock"></b>		&nbsp;
									<b>IP : <?php echo checks::checkIPClient(); ?> </b> &nbsp;
								<a/>	
							</div>
					</center>
				</div>
			</div>
		<?php
			} else {
		?>
				<script>window.location.href=("loiduongdan.php");</script>
		<?php
			}
		?>
		
    </body>
</html>